Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cover select all edge cases #10187

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

ashtonG
Copy link
Contributor

@ashtonG ashtonG commented Nov 1, 2024

Ticket

ET-844

Description

this changes the select all logic. previously the select all prompt would appear when selecting more than the page limit's worth of objects across the result set. if the selected count equaled the total rows in the result set, the clear selection prompt would appear. now, the select all prompt appears when the selection includes all visible rows in the result set, but the selection is not the entire result set. if the selection otherwise exceeds the page limit, we show the clear selection prompt.

this fixes the select all prompt appearing when selecting single rows across pages, as well as the select all prompt not appearing when selecting all rows on the last page of results that does not hit the page limit. there was also an issue where, for searches and experiments, the select all prompt would appear when selecting 20 rows regardless of the page size, which is also fixed here.

Test Plan

when visiting the new experiment list, searches page, or runs page, when selecting all rows on the current page, the select all prompt should appear. after that, all rows in the table should appear selected. when deselecting a row, the clear selection prompt should appear. if you then navigate to the next page, the select all prompt should appear again.

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

this changes the select all logic. previously the select all prompt
would appear when selecting more than the page limit's worth of objects
across the list. if the selected count equaled the total rows in the
result set, the clear selection prompt would appear. now, the select all
prompt appears when the selection includes all visible rows in the
result set, but the selection is not the entire result set. if the
selection otherwise exceeds the page limit, we show the clear selection prompt.

this fixes the select all prompt appearing when selecting single rows
across pages, as well as the select all prompt not appearing when
selecting all rows on the last page of results that does not hit the
page limit. there was also an issue where, for searches and experiments,
the select all prompt would appear when selecting 20 rows regardless of
the page size, which is also fixed here.
@ashtonG ashtonG requested a review from a team as a code owner November 1, 2024 18:29
@cla-bot cla-bot bot added the cla-signed label Nov 1, 2024
Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit c48f016
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/672a5b7d841d760008d64b6c
😎 Deploy Preview https://deploy-preview-10187--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@thiagodallacqua-hpe thiagodallacqua-hpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this breaks the Deselect step in the experimentSpec beforeEach, which then breaks some of the tests. Here's the function that isn't working:

    await test.step('Deselect', async () => {
      const count = await getCount();
      if (count !== 0) {
        await grid.headRow.clickSelectHeader();
        const isClearSelectionVisible =
          await projectDetailsPage.f_experimentList.tableActionBar.clearSelection.pwLocator.isVisible();
        if (isClearSelectionVisible) {
          await projectDetailsPage.f_experimentList.tableActionBar.clearSelection.pwLocator.click();
        }
      }
    });

@ashtonG ashtonG requested a review from a team as a code owner November 5, 2024 17:52
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 30 lines in your changes missing coverage. Please review.

Project coverage is 50.86%. Comparing base (2597fa1) to head (c48f016).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
webui/react/src/pages/FlatRuns/FlatRuns.tsx 5.26% 18 Missing ⚠️
webui/react/src/components/LoadableCount.tsx 75.00% 7 Missing ⚠️
...bui/react/src/pages/F_ExpList/F_ExperimentList.tsx 0.00% 3 Missing ⚠️
webui/react/src/components/TableActionBar.tsx 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10187      +/-   ##
==========================================
- Coverage   54.32%   50.86%   -3.47%     
==========================================
  Files        1259      953     -306     
  Lines      157303   130328   -26975     
  Branches     3644     3651       +7     
==========================================
- Hits        85462    66287   -19175     
+ Misses      71708    63908    -7800     
  Partials      133      133              
Flag Coverage Δ
harness ?
web 54.32% <60.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
webui/react/src/components/Searches/Searches.tsx 61.58% <100.00%> (-0.13%) ⬇️
webui/react/src/components/TableActionBar.tsx 72.35% <91.30%> (+0.30%) ⬆️
...bui/react/src/pages/F_ExpList/F_ExperimentList.tsx 0.00% <0.00%> (ø)
webui/react/src/components/LoadableCount.tsx 92.55% <75.00%> (-1.77%) ⬇️
webui/react/src/pages/FlatRuns/FlatRuns.tsx 11.16% <5.26%> (-0.05%) ⬇️

... and 307 files with indirect coverage changes

Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ashtonG ashtonG merged commit 11a2581 into main Nov 5, 2024
82 of 94 checks passed
@ashtonG ashtonG deleted the bug/ET-844/improved-select-all-heuristics branch November 5, 2024 21:13
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
hkang1 added a commit that referenced this pull request Nov 18, 2024
hkang1 added a commit that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants